Write avoidance areas around bad blocks on a hard disk drive platter

ABSTRACT

A method and computer program product identify the location of a bad block on a disk platter of a hard disk drive, determine an avoidance area extending from the bad block, and prevent data from being written to the avoidance area.

BACKGROUND

1. Field of the Invention

The present invention relates to the storage of data on hard diskdrives, and more specifically relates to methods of dealing with badportions of the disk.

2. Background of the Related Art

Data storage is a fundamental function of any computer system. Thevarious types of data storage devices each have their own role and mayfind a specialized role that takes advantage of their strengths whileminimizing their weaknesses. For example, hard disk drives are good atstoring large amounts of data and, because they are non-volatile, theycan store data without continual application of electricity. However,hard disk drives are also much slower than RAM, flash or cache memory,so any given computer system is unlikely to rely solely on a hard diskdrive.

Still, hard disk drives are used in most notebook computers, desktopcomputers, servers, redundant arrays of independent disks (RAID)systems, storage area networks, and datacenters. These hard disk drivesare responsible for storing operating systems, applications, and filesand data of all types. The reliable operation of the hard disk drives isimperative to the operation of the computer systems that use those harddisk drives.

A hard disk drive includes one or more rotating disc-shaped platters andmagnetic heads arranged on a moving actuator arm to read and write datato the surfaces of the platters. Unfortunately, the surface of a plattermay become scratched or develop a crack, thereby making one or moreblock or sector of the platter unusable. Such a damaged area of aplatter may be referred to as “failed” or “bad”, and the blocks that areassociated with the damaged area may be referred to as “failed blocks”or “bad blocks.” Data previously stored in a failed block is likely tobe corrupted or unreadable, and data may no longer be reliably writtento the failed block.

BRIEF SUMMARY

One embodiment of the present invention provides a computer programproduct including computer readable program code embodied on a computerreadable storage medium. The computer program product comprises computerreadable program code for identifying the location of a bad block on adisk platter of a hard disk drive, computer readable program code fordetermining an avoidance area extending from the bad block, and computerreadable program code for preventing data from being written to theavoidance area.

Another embodiment of the present invention provides a method comprisingidentifying the location of a bad block on a disk platter of a hard diskdrive, determining an avoidance area extending from the bad block, andpreventing data from being written to the avoidance area.

BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS

FIG. 1 is diagram of a hard disk drive platter having a bad block.

FIG. 2 is a diagram of one portion of a hypothetic platter having threebad blocks, each with their own avoidance area.

FIG. 3 is a diagram of a plurality of non-contiguous bad blocksencompassed by an avoidance area.

FIG. 4 is a diagram of a platter where the number of bad blocks isgrowing over time.

FIG. 5 is a diagram of a portion of a platter illustrating one method ofdetermining an avoidance area for a group of bad blocks.

FIG. 6 is a diagram of a portion of a platter illustrating anothermethod of determining an avoidance area for a group of bad blocks.

FIG. 7 is a diagram of a portion of a platter illustrating a furthermethod of determining an avoidance area for a group of bad blocks.

FIG. 8 is a diagram of a portion of a platter illustrating yet anothermethod of determining an avoidance area having a number of bad blocks.

FIG. 9 is a diagram of a hard disk drive.

FIG. 10 is a flowchart of a method in accordance with one embodiment ofthe present invention.

DETAILED DESCRIPTION

One embodiment of the present invention provides a computer programproduct including computer readable program code embodied on a computerreadable storage medium. The computer program product comprises computerreadable program code for identifying the location of a bad block on adisk platter of a hard disk drive, computer readable program code fordetermining an avoidance area extending from the bad block, and computerreadable program code for preventing data from being written to theavoidance area. The computer program product may optionally includeadditional computer readable program code to implement any one or morefeatures or aspects of the methods described herein.

Another embodiment of the present invention provides a method comprisingidentifying the location of a bad block on a disk platter of a hard diskdrive, determining an avoidance area extending from the bad block, andpreventing data from being written to the avoidance area.

Embodiments of the present invention recognize that failing areas of ahard disk drive platter may indicate a likely expansion in certainareas. For example, the disk could have a manufacturing defect and/ordamage resulting from use or mishandling of the hard disk drive.Accordingly, not only is it important to identify the location of theone or more bad blocks that have already failed, but to avoid use ofthose locations that are likely to become bad blocks. By anticipatingadditional failures, embodiments of the invention are capable ofavoiding or reducing an amount of lost data. One or more features of anembodiment of the invention may be implemented in a hard disk drivecontroller or driver.

As used herein, the term “bad block” refers to any contiguous region ofthe platter that has been damaged, fails, or is otherwise no longersuitable for storage of data. Accordingly, in a platter having multiplebad blocks, each bad block will be separated from any other bad block byan area where data can still be stored. It should be recognized that thearea separating two bad blocks becomes damaged and becomes identified as“bad”, then it is possible for the original two bad blocks to merge intoa single bad block that includes the area of the original two bad blocksas well as the currently identified area of damage there between.

Embodiments of the invention include determining an avoidance areaextending from the bad block. Where the bad block is located along anedge of the platter, the avoidance area may extend inwardly from the badblock. Preferably an avoidance area will extend around all availablesides of the bad block, but where the bad block is along the edge of theplatter, the avoidance area is unable to encompass the bad block. Wherethe bad block is located away from an edge of the platter, the avoidancearea will extend in one or more direction from the bad block.Preferably, the avoidance area will extend in all directions from thebad block, such that the avoidance area “encompasses” the bad block.However, there may be instances where either the nature of the damage tothe bad block or the dynamics of the read/write head of the hard diskdrive may be adequately addressed by an avoidance area that extends inone or more direction without encompassing the entirety of the badblock.

A further embodiment may include notifying a user that the capacity ofthe hard disk drive has been reduced by the amount of the avoidancearea. Such notice may take the form of displaying a message to the user.

Yet another embodiment includes copying data stored in the avoidancearea to a destination area other than the avoidance area. Since theavoidance area is intended to reflect an increased risk of bad blocksappearing in the area proximate to one or more known bad block, it isprudent to move data stored in the avoidance area before the data islost. This anticipatory action can prevent later recovery efforts andimprove data reliability. Furthermore, the destination area may belocated on the same hard disk drive outside of the avoidance area, butmay also be located on a different storage device.

As mentioned above, embodiments of the invention include preventing datafrom being written to the avoidance area. Optionally, the method willprevent data from being written to the avoidance area until the diskreaches a utilization threshold. In response to meeting or exceeding theutilization threshold, data may be written into the avoidance area.However, the user is preferably notified that the avoidance area isbeing used so that additional storage capacity can be installed. In afurther option, the method may prevent data from being written to theavoidance area until the disk has an insufficient amount of availablearea to store data in a given write operation.

When a bad block has been identified, the location of the bad block maybe identified by a physical memory address or a list or range ofphysical memory addresses. These physical memory addresses may, forexample, be stored in memory accessible to the hard disk drivecontroller so that the controller will not direct any data to be writtenin the bad block. Similarly, the avoidance area may be identified by alist or range of physical memory addresses. It should be recognized thata physical memory address may take various forms, such as polarcoordinates.

Embodiments of the invention may further include monitoring foradditional bad blocks over time, whether such monitoring is continual orperiodic. In response to identifying the location of an additional badblock on the hard disk drive, the method may expand the avoidance areato encompass the additional bad block. Furthermore, even if theadditional bad block falls within an existing avoidance area, theavoidance area is preferably expanded further to retain or increase thedegree of unused area around the known bad blocks.

In addition, embodiments of the invention may further includeidentifying a group of bad blocks, wherein each bad block within thegroup is within a threshold distance from at least one other bad block.Accordingly, bad blocks that are close together may be treated as agroup. The group may be in the nature of a cluster of bad blocks, aserial string of bad blocks, or any other pattern that may occur.Accordingly, the avoidance area may extend from an area defined by thegroup of bad blocks. Grouping the proximate bad blocks prior todetermining an avoidance area may simplify the determination of theavoidance area and reduce the amount of work necessary to prevent use ofthe avoidance area.

In one alternative, embodiments of the invention may identify a group ofbad blocks within an area having greater than a threshold density of badblocks, and then determine an avoidance area extending from the group ofbad blocks. A “threshold density of bad blocks” refers to the number offailed blocks per unit area of the platter. In one embodiment, a map ofthe platter is formed based on the density of block failures, such thatthe area inside the “pattern of failure” has a failure density that isgreater than the threshold of density, and the area outside the “patternof failure” has a failure density that is less than the thresholddensity.

When there are additional bad blocks identified as part of a group ofbad blocks, the method may further determine a growth rate of the areaof the group of bad blocks. The avoidance area may then be expanded at aproportional rate or logarithmic rate relative to the growth rate of thearea of the group of bad blocks. For example, the growth rate of the badblock area might be measured as the [(area of a current pattern offailure)−(area of a previous pattern of failure)]/(time period passingbetween measurement of the previous and current patterns). Accordingly,the avoidance area may be made to expand at some factor times the growthrate.

FIG. 1 is a diagram of a hard disk drive platter 10 having an outercircumferential edge 12 and a central region 14 for receiving a spindlethat spins the platter 10. The platter 10 in FIG. 1 has a scratch 16that forms at least one bad block.

FIG. 2 is a diagram of one portion of a hypothetic platter 10 havingthree bad blocks 20, 21, 22, each with their own avoidance area 23, 24,25, respectively. One bad block 20 is located along the outercircumferential edge 12 of the platter 10, and its avoidance areaextends uniformly from all accessible sides of the bad block 20. Asecond bad block 21 has a triangular shape, as does the avoidance area24 that encompasses the second bad black 21. A third bad block 22 has anirregular shape and an avoidance area 25 extending directionally fromone side of the third bad block 22, presumably due to a conclusion thatthe nature of the third bad block 22 will tend to only grow in thedirection of the avoidance area 25. In accordance with embodiments ofthe invention, a method may alter the disk write strategy to preventwriting data in the avoidance areas.

FIG. 3 is a diagram of a portion of a platter 10 having a group of badblocks 30 encompassed by an avoidance area 32. Here, the avoidance area32 has been determined in a manner that reflects the general pattern ofthe bad blocks 30. However, other avoidance area shapes would besuitable. The bad blocks are close enough to be handled as a group, andthe “avoidance area” is some factor larger than the group. Data isprevented from being written into the avoidance area in anticipation ofhaving further bad blocks in that area.

FIG. 4 is a diagram of a group of bad blocks that is growing over time.A first (left-most) avoidance area 40 encompasses the bad blocks 41 thathave been identified at a first time, t1. A second (center) avoidancearea 42 encompasses the bad blocks 43 that have been identified at asecond (later) time, t2. A third (right-most) avoidance area 44encompasses the bad blocks 45 that have been identified at a third time,t3. Accordingly, the diagram reflects that as time proceeds from t1 tot2 to t3, the number of bad blocks in the group increases from 9 to 14to 18, respectively. The growth of the group may, in accordance withcertain embodiments of the invention, result in a proportionally greatergrowth of the avoidance area, as reflect by the increased size of theavoidance areas (from left to right) and even the greater amount ofavoidance area separating the bad blocks from the area outside theavoidance area.

FIG. 5 is a diagram illustrating one method of determining an avoidancearea 50 for a group of bad blocks 52. Here, the avoidance area 50 isdetermined to encompass the bad blocks 52 by identifying the two mostdistant bad blocks 53, 54 in the group, identify a center point 55 therebetween, then use that as the center of a circle having a radius (r)that is some percentage (here, about 30%) greater than half the distancebetween the two most distant points. Such a methodology may beprogrammed for execution by the memory controller.

FIG. 6 is a diagram of another method of determining an avoidance area60 for a group of bad blocks 62. In this method, every individual badblock 62 is treated the same as a bad block 62 that was not part of agroup. An individual avoidance area 63 is determined in response to eachbad block 62. However, this method is less preferred because it canresult in small skipped areas 64 and the because the irregularboundaries of the avoidance area 60 may cause an increase in the amountof work that the hard disk drive controller must do to determine wheredata may or may not be stored.

FIG. 7 is a diagram of a further method of determining an avoidance area70 for a group of bad blocks 72. In this method, a (conceptual) line isdrawn between pairs of bad blocks, where one bad block is within athreshold distance from another bad block. No line is drawn between badblocks that are separated by a distance greater than the thresholddistance. Then, the locus of points that are equidistant from the linesand blocks form the boundary of the avoidance area 70. As shown, thereare three bad blocks 76 that are with the threshold distance from eachother, but none of those three bad blocks 76 are within the thresholddistance from the bad blocks 72. Accordingly, the three bad blocks 76form their own group defining a separate avoidance area 74.

FIG. 8 is a diagram of yet another method of determining an avoidancearea 80 having a number of bad blocks 82. As shown, the bad blocks 82are somewhat linear, suggesting that the platter may have been scratchedat some point during manufacture, shipping or use. A linear regressionmay be used to define a centerline 84 of the bad blocks 82 in the group.The avoidance area 80 may then extend outward from the group of badblocks 82 in proportion to the group dimension along or away from thecenterline. This method might be used to reflect the tendency of certaindamages areas to propagate linearly.

FIG. 9 is a diagram of a hard disk drive 90. A circular platter 91 spinsabout a spindle 92 and a read/write arm 93 is positioned over theplatter 91 by an actuator 94. A hard disk drive controller 95 controlsthe actuator 94 to position the read/write arm 93 at particular physicaladdresses where data is to be written to the platter or read from theplatter 91. When a bad block is identified, its physical address isstored in memory 96. When an avoidance area has been determined for aparticular bad block or group of bad blocks, then the avoidance area isstored in memory 97. As the hard disk drive controller 95 receivesinstructions through its I/O port 98, the controller 95 consults theavoidance areas 97 to determine where data may be written. Similarly,the controller 95 may copy data from within an avoidance area to a newlocation that is outside the avoidance area.

FIG. 10 is a flowchart of a method 100 in accordance with one embodimentof the present invention. In step 102, the method identifies thelocation of a bad block on a disk platter of a hard disk drive. Step 104determines an avoidance area extending from the bad block, and step 106prevents data from being written to the avoidance area.

As will be appreciated by one skilled in the art, the present inventionmay be embodied as a system, method or computer program product.Accordingly, the present invention may take the form of an entirelyhardware embodiment, an entirely software embodiment (includingfirmware, resident software, micro-code, etc.) or an embodimentcombining software and hardware aspects that may all generally bereferred to herein as a “circuit,” “module” or “system.” Furthermore,the present invention may take the form of a computer program productembodied in one or more computer-readable storage medium havingcomputer-usable program code stored thereon.

Any combination of one or more computer usable or computer readablestorage medium(s) may be utilized. The computer-usable orcomputer-readable storage medium may be, for example but not limited to,an electronic, magnetic, electromagnetic, or semiconductor apparatus ordevice. More specific examples (a non-exhaustive list) of thecomputer-readable medium include: a portable computer diskette, a harddisk, random access memory (RAM), read-only memory (ROM), an erasableprogrammable read-only memory (EPROM or Flash memory), a portablecompact disc read-only memory (CD-ROM), an optical storage device, or amagnetic storage device. In the context of this document, acomputer-usable or computer-readable storage medium may be any storagemedium that can contain or store the program for use by a computer.Computer usable program code contained on the computer-usable storagemedium may be communicated by a propagated data signal, either inbaseband or as part of a carrier wave. The computer usable program codemay be transmitted from one storage medium to another storage mediumusing any appropriate transmission medium, including but not limited towireless, wireline, optical fiber cable, RF, etc.

Computer program code for carrying out operations of the presentinvention may be written in any combination of one or more programminglanguages, including an object oriented programming language such asJava, Smalltalk, C++ or the like and conventional procedural programminglanguages, such as the “C” programming language or similar programminglanguages. The program code may execute entirely on the user's computer,partly on the user's computer, as a stand-alone software package, partlyon the user's computer and partly on a remote computer or entirely onthe remote computer or server. In the latter scenario, the remotecomputer may be connected to the user's computer through any type ofnetwork, including a local area network (LAN) or a wide area network(WAN), or the connection may be made to an external computer (forexample, through the Internet using an Internet Service Provider).

The present invention is described below with reference to flowchartillustrations and/or block diagrams of methods, apparatus (systems) andcomputer program products according to embodiments of the invention. Itwill be understood that each block of the flowchart illustrations and/orblock diagrams, and combinations of blocks in the flowchartillustrations and/or block diagrams, can be implemented by computerprogram instructions. These computer program instructions may beprovided to a processor of a general purpose computer, special purposecomputer, or other programmable data processing apparatus to produce amachine, such that the instructions, which execute via the processor ofthe computer or other programmable data processing apparatus, createmeans for implementing the functions/acts specified in the flowchartand/or block diagram block or blocks.

These computer program instructions may also be stored in acomputer-readable storage medium that can direct a computer or otherprogrammable data processing apparatus to function in a particularmanner, such that the instructions stored in the computer-readablestorage medium produce an article of manufacture including instructionmeans which implement the function/act specified in the flowchart and/orblock diagram block or blocks.

The computer program instructions may also be loaded onto a computer orother programmable data processing apparatus to cause a series ofoperational steps to be performed on the computer or other programmableapparatus to produce a computer implemented process such that theinstructions which execute on the computer or other programmableapparatus provide processes for implementing the functions/actsspecified in the flowchart and/or block diagram block or blocks.

The flowchart and block diagrams in the Figures illustrate thearchitecture, functionality, and operation of possible implementationsof systems, methods and computer program products according to variousembodiments of the present invention. In this regard, each block in theflowchart or block diagrams may represent a module, segment, or portionof code, which comprises one or more executable instructions forimplementing the specified logical function(s). In some alternativeimplementations, the functions noted in the block may occur out of theorder noted in the figures. For example, two blocks shown in successionmay, in fact, be executed substantially concurrently, or the blocks maysometimes be executed in the reverse order, depending upon thefunctionality involved. Each block of the block diagrams and/orflowchart illustration, and combinations of blocks in the block diagramsand/or flowchart illustration, can be implemented by special purposehardware-based systems that perform the specified functions or acts, orcombinations of special purpose hardware and computer instructions.

The terminology used herein is for the purpose of describing particularembodiments only and is not intended to be limiting of the invention. Asused herein, the singular forms “a”, “an” and “the” are intended toinclude the plural forms as well, unless the context clearly indicatesotherwise. It will be further understood that the terms “comprises”and/or “comprising,” when used in this specification, specify thepresence of stated features, integers, steps, operations, elements,components and/or groups, but do not preclude the presence or additionof one or more other features, integers, steps, operations, elements,components, and/or groups thereof. The terms “preferably,” “preferred,”“prefer,” “optionally,” “may,” and similar terms are used to indicatethat an item, condition or step being referred to is an optional (notrequired) feature of the invention.

The corresponding structures, materials, acts, and equivalents of allmeans or steps plus function elements in the claims below are intendedto include any structure, material, or act for performing the functionin combination with other claimed elements as specifically claimed. Thedescription of the present invention has been presented for purposes ofillustration and description, but it is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the artwithout departing from the scope and spirit of the invention. Theembodiment was chosen and described in order to best explain theprinciples of the invention and the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated.

What is claimed is:
 1. A computer program product including computerreadable program code embodied on a non-transitory computer readablestorage medium, the computer program product including: computerreadable program code for identifying the location of a bad block on aplatter of a hard disk drive; computer readable program code fordetermining an avoidance area extending from the bad block andencompassing the bad block; and computer readable program code forpreventing data from being written to the avoidance area.
 2. Thecomputer program product of claim 1, further comprising: computerreadable program code for notifying a user that the capacity of the harddisk drive has been reduced by the amount of the avoidance area.
 3. Thecomputer program product of claim 1, further comprising: computerreadable program code for copying data stored in the avoidance area to adestination area other than the avoidance area.
 4. The computer programproduct of claim 3, wherein the destination area is on the same harddisk drive outside of the avoidance area.
 5. The computer programproduct of claim 1, further comprising: computer readable program codefor preventing data from being written to the avoidance area until thedisk reaches a utilization threshold.
 6. The computer program product ofclaim 1, further comprising: computer readable program code forpreventing data from being written to the avoidance area until the diskhas an insufficient amount of available area to store data in a writeinstruction.
 7. The computer program product of claim 1, wherein thelocation of the bad block is identified by a physical memory address. 8.The computer program product of claim 1, further comprising: computerreadable program code for identifying the location of an additional badblock on the hard disk drive; and computer readable program code forexpanding the avoidance area to encompass the additional bad block. 9.The computer program product of claim 1, further comprising: computerreadable program code for identifying a group of bad blocks, whereineach bad block within the group is within a threshold distance from atleast one other bad block; and wherein the computer readable programcode for determining an avoidance area extending from the bad blockincludes computer readable program code for determining an avoidancearea extending from the group of bad blocks.
 10. The computer programproduct of claim 9, further comprising: computer readable program codefor determining a growth rate of the area of the group of bad blocks,wherein the avoidance area is expanded at a rate proportional to thegrowth rate of the area of the group of bad blocks.
 11. The computerprogram product of claim 9, further comprising: computer readableprogram code for determining a growth rate of the area of the group ofbad blocks, wherein the avoidance area is expanded at a logarithmic raterelative to the growth rate of the area of the group of bad blocks. 12.The computer program product of claim 1, further comprising: computerreadable program code for identifying a group of bad blocks within anarea having greater than a threshold density of bad blocks; and whereinthe computer readable program code for determining an avoidance areaextending from the bad block includes computer readable program code fordetermining an avoidance area extending from the group of bad blocks.13. A computer-implemented method, comprising: identifying the locationof a bad block on a disk platter of a hard disk drive; determining anavoidance area extending from the bad block and encompassing the badblock; and preventing data from being written to the avoidance area. 14.The method of claim 13, further comprising: notifying a user that thecapacity of the hard disk drive has been reduced by the amount of theavoidance area.
 15. The method of claim 13, further comprising: copyingdata stored in the avoidance area to a destination area other than theavoidance area.
 16. The method of claim 13, further comprising:preventing data from being written to the avoidance area until the diskreaches a utilization threshold.
 17. The method of claim 13, furthercomprising: identifying the location of an additional bad block on thehard disk drive; and expanding the avoidance area to encompass theadditional bad block.
 18. The method of claim 13, further comprising:identifying a group of bad blocks, wherein each bad block within thegroup is within a threshold distance from at least one other bad block,wherein the avoidance area extends from the group of bad blocks.
 19. Themethod of claim 13, further comprising: identifying a group of badblocks within an area having greater than a threshold density of badblocks, wherein the avoidance area extends from the group of bad blocks.